package com.example.springboot.config;

import com.example.springboot.intercepter.TestIntercepter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 注册bean
 */
@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter {

	@Autowired
	private TestIntercepter testInterceptor;


	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(testInterceptor);
	}


}